package com.gedeshidai.shumadevelop.ProductCheck;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gedeshidai.shumadevelop.common.BaseResponse;
import com.gedeshidai.shumadevelop.controller.ProductController;
import com.gedeshidai.shumadevelop.controller.ProductDetailController;
import com.gedeshidai.shumadevelop.model.dto.user.CheckRequest;
import com.gedeshidai.shumadevelop.model.dto.product.AddProxyRequest;
import com.gedeshidai.shumadevelop.model.dto.product.DetailDeleteRequest;
import com.gedeshidai.shumadevelop.model.dto.product.ProductProxyRequest;
import com.gedeshidai.shumadevelop.model.vo.ProductPreviewVO;
import com.gedeshidai.shumadevelop.model.vo.UserVO;
import com.gedeshidai.shumadevelop.service.ProductService;

import com.gedeshidai.shumadevelop.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.*;

@SpringBootTest
public class ProductCheck {
    @Resource
    private UserService userService;
    @Resource
    private ProductService productService;
    @Resource
    ProductDetailController productDetailController;

    @Resource
    ProductController productController;

    /**
     * 查询代理人单侧
     *
     */
    @Test
    void getProxysById(){
        ProductProxyRequest productProxyRequest =new ProductProxyRequest();
        productProxyRequest.setId(1L);
        BaseResponse<Page<UserVO>> proxysById = productController.getProxysById(productProxyRequest);
        System.out.println(proxysById);
    }
    /**
     * 发起商品预览
     */
    @Test
    void getPreviewByIdDemo(){
        ProductProxyRequest productProxyRequest =new ProductProxyRequest();
        productProxyRequest.setId(1L);
//        BaseResponse<ProductPreviewVO> response= productDetailController.getPreviewById(productProxyRequest);
//        System.out.println(response);
    }
    /**
     * 批量删除代理人单侧
     */
    @Test
    void delete(){
        DetailDeleteRequest detailDeleteRequest=new DetailDeleteRequest();
        String s="zhangsan";
        List<String> list=new ArrayList<>();
        list.add(s);
        detailDeleteRequest.setProxys(list);
        detailDeleteRequest.setId(1L);
        BaseResponse response= productController.deleteProxys(detailDeleteRequest);
        System.out.println(response);
    }

    /**
     * 添加代理人单侧
     */
    @Test
    void addProxy(){
        AddProxyRequest addProxyRequest=new AddProxyRequest();
        String s1="zhangsan";
        String s2="xiaoer";
        String s3="lisi";
        addProxyRequest.setUserAccount(s3);
        addProxyRequest.setId(1L);
        BaseResponse response= productController.addProxy(addProxyRequest);
        System.out.println(response);
    }
    /**
     * 发起审核单侧
     */
    @Test
    void goCheckDemo(){
        CheckRequest checkRequest=new CheckRequest();
        checkRequest.setId(1L);
        checkRequest.setRemark("发起审核备注");
//        BaseResponse<Boolean> response= userController.goCheck(checkRequest);
//        System.out.println(response);
    }

    /**
     * 审核通过单侧
     */
    @Test
    void checkPassDemo(){
        CheckRequest checkRequest=new CheckRequest();
        checkRequest.setId(1L);
        checkRequest.setRemark("审核通过备注");
        BaseResponse<Boolean> response= userService.checkPass(checkRequest);
        System.out.println(response);

    }

    /**
     * 审核驳回单侧
     */
    @Test
    void reCheckDemo(){
        CheckRequest checkRequest=new CheckRequest();
        checkRequest.setId(1L);
        checkRequest.setRemark("审核驳回备注");
        BaseResponse<Boolean> response= userService.reCheck(checkRequest);
        System.out.println(response);

    }

    /**
     * 普通单侧
     */

    @Test
    void test(){
        System.out.println("ok");
    }


}
